Conditions | 4 |
Paths | 7 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | export default applyOptions; |
||
19 | function convertOption(data, type) { |
||
20 | if (type === 'string') { |
||
21 | return '' + data; |
||
22 | } |
||
23 | else if (type === 'number') { |
||
24 | return parseInt(data, 10); |
||
25 | } |
||
26 | else if (type === 'boolean') { |
||
27 | return (typeof data === 'boolean' && data) || data === 'true' || data === 'True'; |
||
28 | } |
||
29 | else { |
||
30 | return data; |
||
31 | } |
||
32 | } |
||
33 |